<?php

class PhotosController extends AppController {
	
	public $helpers = array('Html', 'Form', 'Session', 'Time');
	public $components = array('Session');
	
	public function index() {
		$this->set('photos', $this->paginate());
	}
	
	public function edit() {
		
	}
	
	public function add() {
		if ($this->request->is('post')) {
			$this->Photo->create();
			$data = $this->request->data;
			debug($data);
			if ($this->Photo->save($data)) {
				$this->Session->setFlash(__('Saved'));
// 				return $this->redirect(array('action' => 'index'));
			}
			$this->Session->setFlash(__('Failed'));
		}
	}
	
}

?>